package com.aaa.tmr.util;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import sun.awt.ModalityListener;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ：Marko
 * @date ：Created in 2021/3/10 10:35
 * @description ：
 * @modified By：
 * @version:
 */
@ControllerAdvice
public class GlobalExceptionHandlerUtil  {

   /* @Override
    public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {

        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("error");
//        modelAndView.addObject("exception",e);
        modelAndView.addObject("name","测试用例" );
        return modelAndView;
    }*/

   public String error(Model model){
       model.addAttribute("name","测试用例");
       return "error";
   }
}
